<script lang="ts" setup>
  import ExternalLogins from "./ExternalLogins.vue";
  import LoginForm from "./LoginForm.vue";

  const companyName = import.meta.env.VITE_COMPANY_NAME;
</script>

<template>
  <div class="d-flex flex-column px-2 py-3 border-box login-panel-warp">
    <section class="flex-fill d-flex flex-column align-items-stretch justify-content-center mx-auto login-panel">
      <div class="login-logo text-center mb-4">
        <img class="login-logo--img rounded"
             src="/assets/logo.png"
             :title="companyName" />
      </div>
      <login-form class="mb-5 mx-auto"></login-form>
      <external-logins></external-logins>
    </section>
    <div class="text-center">
      <powered-info></powered-info>
    </div>
  </div>
</template>

<style lang="scss" scoped>
  .login-panel-warp {
    background-color: var(--theme-white);
    /* 参考： https://segmentfault.com/q/1010000020155101
            新标准：    https://ishadeed.com/article/new-viewport-units/ */
    /* height: dvh; lvh; svh */
    min-height: 100svh;
    height: 100vh;
    max-height: 100dvh;
    // padding-bottom: 30px;
    // padding-bottom: constant(safe-area-inset-bottom);
    // padding-bottom: env(safe-area-inset-bottom);
  }
  .login-panel {
    width: 336px;
    max-width: 100%;
  }
  .login-logo {
    > .login-logo--img {
      font-size: 48px;
      width: 1em;
      height: 1em;
    }
  }
</style>

<style lang="scss" scoped>
  @media (prefers-color-scheme: dark) {
    .login-panel {
      background-color: var(--theme-gray-900);
    }
  }
</style>
